//
//  ConsumptionViewController.m
//  Stop
//
//  Created by dllo on 16/3/5.
//  Copyright © 2016年 徐宏飞. All rights reserved.
//

#import "ConsumptionViewController.h"

#import "UnfinishedViewController.h"
#import "FinishedViewController.h"

@interface ConsumptionViewController ()<UIScrollViewDelegate>

@property (nonatomic, retain) UIButton *unfinshButton;
@property (nonatomic, retain) UIButton *finshButton;

@property (nonatomic, retain) UIScrollView *bigScrollView;
@property (nonatomic, retain) UIView *sliderView;


@end

@implementation ConsumptionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"消费记录";
    self.view.backgroundColor = [UIColor greenColor];
    
    
    //关闭自动根据导航条设置scrollView的frame
    [self setAutomaticallyAdjustsScrollViewInsets:NO];
    
    //大scroll
    self.bigScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT- 40)];
    self.bigScrollView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.bigScrollView];
    self.bigScrollView.contentSize = CGSizeMake(SCREEN_WIDTH *2,0);
    self.bigScrollView.pagingEnabled = YES;
    self.bigScrollView.bounces = NO;
    self.bigScrollView.delegate = self;
    
    //小条
    self.sliderView = [[UIScrollView alloc] initWithFrame:CGRectMake(self.unfinshButton.frame.origin.x, self.unfinshButton.frame.origin.y+40, self.unfinshButton.frame.size.width, 2)];
    self.sliderView.backgroundColor = [UIColor orangeColor];
    [self.view addSubview:self.sliderView];
    
    
    //未完成
    UnfinishedViewController *favVC = [[UnfinishedViewController alloc] init];
    [self addChildViewController:favVC];
    favVC.view.frame = CGRectMake(0, 40, SCREEN_WIDTH, SCREEN_HEIGHT);
    [self.bigScrollView addSubview:favVC.view];

    
    //已完成
    FinishedViewController *hisVC = [[FinishedViewController alloc] init];
    hisVC.view.frame = CGRectMake(SCREEN_WIDTH, 40, SCREEN_WIDTH, SCREEN_HEIGHT);
    [self addChildViewController:hisVC];
    [self.bigScrollView addSubview:hisVC.view];
    
    
 
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
